﻿<%@ Page Language="C#" %>

<%@ Import Namespace="wojilu" %>
<%@ Import Namespace="wojilu.View" %>
<%@ Import Namespace="wojilu.Apps.Qycms.Domain" %>
<%@ Import Namespace="wojilu.Apps.Qycms.Service" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>#{softtitle}</title>
<link href="#{path.css}ybb/css/baselist.css?v=#{cssVersion}" rel="stylesheet" type="text/css" />
<link href="#{path.css}ybb/css/all.css?v=#{cssVersion}" rel="stylesheet" type="text/css" />
<link href="#{path.css}ybb/css/formdiv.css?v=#{cssVersion}" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="#{path.js}ybb/js/jquery.js?v=#{jsVersion}"></script>
<script type="text/javascript" src="#{path.js}ybb/js/control.js?v=#{jsVersion}"></script>
<script type="text/javascript" src="#{path.js}ybb/js/form.js?v=#{jsVersion}"></script>
<script type="text/javascript" src="/static/public/tinyMCE/jquery.tinymce.js?v=#{jsVersion}"></script>
<script type="text/javascript" src="#{path.js}ybb/js/initedit.js"></script>
<script type="text/javascript">

	var resizewindow= null;

	window.onresize = function(){
		var h = $(window).height();
		if(resizewindow!=h){
			sizewindow();
			resizewindow=h;
		}
	}

	function sizewindow(){
		var h = $(window).height();
		if(document.getElementById("mainbodybottonauto")){
			$('.managebottonadd').css({height:h-40});
		}
	}
	var formmessmain_js_content_mess = "_{formmessmain_js_content_mess}";
	var formmessmain_js_add_ok = "_{formmessmain_js_add_ok}";
	var formmessmain_js_add_no = "_{formmessmain_js_add_no}";
	var iframename = "#{iframename}";
	$(document).ready(function(){
	    var h = '#{iframeheightwindow}';
		$('.managebottonadd').css({height:h-40});
		editsimpleshow_height("#content");
		var options = {
			beforeSubmit: formverify,
			success:saveResponse,
			resetForm: false
		}
		$('#forumedit').submit(function() {
			$(this).ajaxSubmit(options);
			return false;
		});
	})




	function formverify(formData) {
		for (var i=0; i< formData.length; i++){
			if (formData[i].name == "content"){
				formData[i].value=tinyMCE.get('content').getContent()
			}
		}
		var queryString = $.param(formData);
		var get=urlarray(queryString);
		if(get['content']==''){
			alert(formmessmain_js_content_mess);
			return false;
		}
		parent.windowsdig('Loading','iframe:#{load}','400px','180px','iframe',false);
	}
	function saveResponse(options){
		parent.closeifram();
		if (options=='true'){
			parent.frames[iframename].refresh('selectform','selectall','check_all');
			alert(formmessmain_js_add_ok);
		}else{
			alert(formmessmain_js_add_no);
		}
		var refalse = "#{refalse}";
		if (refalse!='1'){
			parent.onaletdoc();
		}else{
			window.location.reload();
		}
	}
</script>
</head>

<body>
<%var read = v.data("read") as Bbs; %>
<form name="forumedit" id="forumedit" method="post" action="#{ActionLink}">
<div id="mainbodybottonauto" class="managebottonadd">
	<div class="maindobycontent">
		<div class="suggestion">
			<span class="sugicon"><span class="strong colorgorning2">_{position_title}</span><span class="colorgorningage">_{forummain_edit_mess_copy}“<u>#{read.title}</u>”</span></span>
		</div>
		<div class="manageeditdiv">
			<div class="maneditcontent">
			<table class="formtable">
				<tr class="trstyle2">
					<td class="trtitle01">_{forummain_add_formgroupname}</td>
					<td class="trtitle02">#{read.title}</td>
				</tr>
				<tr class="trstyle2">
					<td class="trtitle01">_{forummain_add_content}</td>
					<td class="trtitle02">#{read.content}</td>
				</tr>
				<tr class="trstyle2">
					<td class="trtitle011">_{forummain_add_content_re}</td>
					<td class="trtitle02"><textarea name="content" id="content" class="smallInput"></textarea></td>
				</tr>
				<tr>
					<td class="trtitle03" colspan="2">_{forummain_add_other_mess}</td>
				</tr>
                <%if(read.userid>0){ %>
                <%PowerGroup modelpowergroup = v.data("powergroup") as PowerGroup; %>
                <%var bllPowerGroupService = new PowerGroupService(); %>
                <%var user = wojilu.Members.Users.Domain.User.findById(read.userid); %>
				<tr class="trstyle2">
					<td class="trtitle01">_{enquirymain_add_userid}</td>
					<td class="trtitle02"><%=user.Name %>  <%if (bllPowerGroupService.powercheck("member", "memberedit", modelpowergroup)) { %><a class="tabclicklink" onclick="javascript:parent.onbotton('_{viewmember_botton}','<%=link.to(new wojilu.Web.Controller.Admin.Qycms.MemberController().MemberEdit,read.Id) %>?type=edit&freshid='+Math.random()+'&iframename='+self.frameElement.getAttribute('name'),true,'memberedit<%=user.Id %>',self.frameElement.getAttribute('name'));" id="memberedit<%=user.Id %>" href="#body" title="<%=user.Name %>" hidefocus="true">_{viewmember_botton}</a> <%} %></td>
				</tr>
				<%} %>
				<tr class="trstyle2">
					<td class="trtitle01">_{forummain_add_addtime}</td>
					<td class="trtitle02">#{read.addtime}</td>
				</tr>
				<tr class="trstyle2">
					<td class="trtitle01">_{forummain_add_click}</td>
					<td class="trtitle02">#{read.click}</td>
				</tr>
			</table>
			</div>
		</div>
	</div>
</div>
<div id="downbotton">
	<div id="subbotton">
		<table border="0" width="100%">
			<tr>
				<td id="right"><input type="submit" id="messsubmitbotton" name="Submit" value="_{botton_remess}" class="buttonface" /></td>
				<td id="left" class="padding-left5"><input type="button" name="cancel" onClick="javascript:parent.onaletdoc();" value="_{botton_remess_reset}" class="buttonface" /></td>
			</tr>
		</table>
	</div>
</div>
<input type="hidden" name="lng" value="#{read.lng}" />
<input type="hidden" name="btid" value="#{read.btid}" />
<input type="hidden" name="reemail" value="#{read.email}" />
<input type="hidden" name="title" value="Re:#{read.title}" />
</form>
</body>

</html>